/**
 * 上午11:17:16
 */
package com.hsnn.medstgmini.base.std.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hsnn.medstgmini.base.std.dao.StdDrugcatalogDao;
import com.hsnn.medstgmini.base.std.model.BidDrugcatas;
import com.hsnn.medstgmini.base.std.model.StdDrugQualitySpecLog;
import com.hsnn.medstgmini.base.std.model.StdDrugcatalog;
import com.hsnn.medstgmini.base.std.model.StdDrugcatalogLog;
import com.hsnn.medstgmini.base.std.service.StdDrugcatalogManager;
import com.hsnn.medstgmini.dao.HibernateSqlUtil;
import com.hsnn.medstgmini.util.Pagination;

/**
 * @author hsnn
 *
 */
@Service("StdDrugcatalogManager")
public class StdDrugcatalogManagerImpl implements StdDrugcatalogManager {

	@Autowired
	private StdDrugcatalogDao stdDrugcatalogDao;

	@Autowired
	private HibernateSqlUtil hibernateSqlUtil;

	@Override
	public void save(StdDrugcatalog stdDrugcatalog) {
		stdDrugcatalogDao.save(stdDrugcatalog);
	}

	@Override
	public List<StdDrugcatalog> getStdDrugcatalogByName(String drugcatalogName) {
		return stdDrugcatalogDao.getStdDrugcatalogByName(drugcatalogName);
	}

	@Override
	public void update(StdDrugcatalog stdDrugcatalog) {
		stdDrugcatalogDao.update(stdDrugcatalog);
	}

	@Override
	public void updateStatus(Pagination page) {
		stdDrugcatalogDao.updateStatus(page);
	}

	
	
	@Override
	public Pagination getStdDrugcatalogList(Pagination page) {
		return stdDrugcatalogDao.getStdDrugcatalogList(page);
	}

	@Override
	public Pagination getStdDrugcatalogLogList(Pagination page) {
		return stdDrugcatalogDao.getStdDrugcatalogLogList(page);
	}
	@Override
	public Pagination getStdDrugcatalogLogLists(Pagination page) {
	return stdDrugcatalogDao.getStdDrugcatalogLogLists(page);
	}
	/**
	 * 根据条件获取不分页数据
	 * @param page
	 * @return page
	 */
	@Override
	public Pagination getDrugcatalogDetailNoPages(Pagination page){
		return stdDrugcatalogDao.getDrugcatalogDetailNoPages(page);
	}

	
	@Override
	public void update(Object entity) {
		stdDrugcatalogDao.update(entity);
	}

	
	@Override
	public Object getUniquerResult(Class<?> entity, String key, String value) {
		return stdDrugcatalogDao.getUniquerResult(entity, key, value);
	}

	/* (non-Javadoc)
	 * @see com.hsnn.medstgmini.base.std.service.StdDrugcatalogManager#save(java.lang.Object)
	 */
	@Override
	public boolean save(Object entity) {
		if (hibernateSqlUtil.add(entity)) {
			return true;
		}
		return false;
	}

	
	@Override
	public Pagination getStdDrugcatalogDetailInfo(Pagination page) {
		return stdDrugcatalogDao.getStdDrugcatalogDetailInfo(page);
	}


	@Override
	public Pagination getStdDrugcatalogDetailInfoAdd(Pagination page) {
		return stdDrugcatalogDao.getStdDrugcatalogDetailInfoAdd(page);
	}

	
	@Override
	public void AddStdDrugcatalogDetailInfo(Pagination page) {
		stdDrugcatalogDao.AddStdDrugcatalogDetailInfo(page);
	}

	/* (non-Javadoc)
	 * @see com.hsnn.medstgmini.base.std.service.StdDrugcatalogManager#compareStdDrugcatalogLog(com.hsnn.medstgmini.base.std.model.StdDrugcatalogLog)
	 */
	@Override
	public StdDrugcatalogLog compareStdDrugcatalogLog(
			StdDrugcatalogLog stdDrugcatalogLog) {
		
		return stdDrugcatalogDao.compareStdDrugcatalogLog(stdDrugcatalogLog);
	}

	/* (non-Javadoc)
	 * @see com.hsnn.medstgmini.base.std.service.StdDrugcatalogManager#getNameByUpdUser(java.lang.String)
	 */
	@Override
	public String getNameByUpdUser(String updUser) {
		return stdDrugcatalogDao.getNameByUpdUser(updUser);
	}
	
	/**
	 * @category 更新药品目录关联表
	 * @author zhouqi
	 * @date 2015年9月24日09:57:34
	 * @param bidDrugCates
	 */
	@Override
	public void updateBidDrugCatas(BidDrugcatas bidDrugCates){
		stdDrugcatalogDao.updateBidDrugCatas(bidDrugCates);
	}
    
	/**
	 * @category 获取药品目录关联信息
	 * @author zhouqi
	 * @date 2015年9月24日09:57:34
	 * @param bidDrugCates
	 */
	@Override
	public BidDrugcatas getBidDrugCatas(String bidDrugCatesId){
		return stdDrugcatalogDao.getBidDrugCatas(bidDrugCatesId);
	}
	
	/**
	 * 根据条件获取不分页数据
	 * @param page
	 * @return page
	 */
	@Override
	public Pagination getDrugcatalogDetailNoPage(Pagination page){
		return stdDrugcatalogDao.getDrugcatalogDetailNoPage(page);
	}
	
	/**
	 * 药物目录维护记录详情
	 * @param page
	 * @return
	 */
	@Override
	public List<Map<String, Object>> getStdDrugcatalogLogDetail(StdDrugcatalogLog stdDrugcatalogLog) {
		return stdDrugcatalogDao.getStdDrugcatalogLogDetail(stdDrugcatalogLog);
	}
	
	
}
